package com.alexeyhanin.tapestry.goodies.guice;

import org.apache.tapestry5.ioc.ObjectProvider;
import org.apache.tapestry5.ioc.OrderedConfiguration;
import org.apache.tapestry5.ioc.ServiceBinder;
import org.apache.tapestry5.ioc.annotations.Local;

/**
 * @author aha
 * @since Aug 20, 2009
 *        $Id: TapestryGuiceModule.java 2 2009-11-26 19:22:03Z gagarin61 $
 */
public class TapestryGuiceModule {

    public static void bind(ServiceBinder serviceBinder) {
        serviceBinder.bind(GuiceObjectProvider.class).withId("GuiceObjectProvider");
    }

    public static void contributeMasterObjectProvider(@Local GuiceObjectProvider guiceObjectProvider,
                                                      OrderedConfiguration<ObjectProvider> configuration) {
        configuration.add("GuiceObjectProvider", guiceObjectProvider, "after:Service");
    }

}
